<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1" session="true"%>
<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
		<title>Payment details</title>
		<link href="CSS.css" rel="stylesheet" type="text/css">
	</head>
	<body>
		<div id="pagehdr">
			<h1>Car Rental reservation system</h1>
		</div>
		<%
		if (request.getAttribute("violation") != null) {
			if (!request.getAttribute("violation").equals("noViolation")) {
			out.write("<br/><span style=\"color:red\"><strong>"
				+ request.getAttribute("violation") +"</strong></span><br/><br/>");
			}
		} else {
		%>
			<p>Please enter your payment details below...</p><br/>
		<%
		}
		%>
		
		<p>Total charge is <strong> $<%=session.getAttribute("totalFee") %></strong></p>
		<p>Insurance excess is <strong> $<%=session.getAttribute("excessAmnt") %></strong></p>
		
		<form action="controller">
			<p><strong>Credit card details:</strong></p>
			<i>Card number </i><input type="number" name="creditCardNumber" min="1" size="16" maxlength="16">
			<i>CSV </i><input type="number" name="creditCardCsv" size="3" min="1" maxlength="3"/><br/><br/>
			<p><strong>Expiration date (MM/YYYY):</strong></p>
			<i>Month </i><input type="number" name="expiryMonth" min="1" size="2" maxlength="2"/>
			<i>/ Year </i><input type="number" name="expiryYear" size="4" maxlength="4"
				min="<%= new java.text.SimpleDateFormat("yyyy").format(new java.util.Date()) %>"/><br/><br/>
			<p><strong>Email:</strong></p>
			<input type="email" name="customerEmail" size="35" maxlength="35"/><br/><br/>
			<input type="hidden" name="op" value="pay"/>
			<input type="submit" value="Pay for booking"/>
		</form>
	</body>
</html>